class BdItemController < ApplicationController
  
  def add_bd_item
    @bd_item = params[:bd_item][:id].blank? ? BdItem.new : BdItem.find(params[:bd_item][:id])
    @bd_item.attributes = params[:bd_item]
    if @bd_item.save
      @requisicao = Requisicao.find(@bd_item.requisicao_id)
    end
  end
  
  def edit_bd_item
    @bd_item = BdItem.find(params[:id])
  end
  
  def del_bd_item
    @bd_item = BdItem.find(params[:id])
    @bd_item.destroy
  end
  
end